import {cell,
  CellGroup, CellBlock, createStore, register, store} from 'components/form'
import Button from "components/items/button";


function template(state, props) {
  const _data = state.mock
  const list = ui_list({
    data: adapter(_data),
    listClass: 'demo-grid num2',
    itemClass: 'ss-default ss-col'
  })
  return (
    <>
      <View className="pages-title-lg">缺省页</View>
      <list.UI />
    </>
  )
}

export default function(Pager) {
  return Pager({
    template,
    data: {
      mock: [
        {title: '请输入查询内容', type: 'search'},
        {title: '正在努力加载中', type: 'loading'},
        {title: '网络出错了', type: 'network'},
        {title: '没有找到相关内容', type: 'find'},
        {title: '暂无历史记录', type: 'record'},
      ]
    },
    onReady(){}
  })
}

function adapter(data) {
  return data.map(item => {
    return {
      img: {
        src: item.type+'.jpg',
        // itemClass: 'item-pic'
      },
      dot: [{
        title: item.title,
        itemClass: 'item-title'
      }],
    }
  })
}